<template>
  <div id="mysubmitbar">
    <van-submit-bar
      :price="totalprice"
      button-text="提交订单"
      @submit="onSubmit"
    >
      <van-checkbox
        v-model="checked"
        @click="checkall"
        checked-color="rgb(238, 10, 36)"
        >全选</van-checkbox
      >
    </van-submit-bar>
  </div>
</template>

<script>
export default {
  name: "MySubmitBar",
  props: {
    totalprice: Number,
    checked: {
      type: Boolean,
      default: false,
    },
  },

  methods: {
    onSubmit() {
      this.$emit("submitorder");
    },
    checkall() {
      this.$emit("checkall", this.checked);
    },
  },
};
</script>

<style scoped>
.van-submit-bar {
  bottom: 50px;
}
</style>
